package cn.xz.mxxz.adapter

import android.graphics.Color
import android.widget.ImageView
import android.widget.TextView
import cn.xz.mxxz.R
import cn.xz.mxxz.bean.AreaList
import cn.xz.mxxz.bean.DreamTitle
import cn.xz.mxxz.bean.LeaderData
import cn.xz.mxxz.bean.SimpleData
import cn.xz.mxxz.util.AppHelper
import cn.xz.mxxz.widgets.XZTextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 *印记搜索适配器*/
class SearchListAdapter: BaseQuickAdapter<SimpleData, BaseViewHolder>(R.layout.item_search_list) {

    override fun convert(holder: BaseViewHolder, item: SimpleData) {

        val tvName = holder.getView<TextView>(R.id.tv_name)
        val ivSelect = holder.getView<ImageView>(R.id.iv_select)

        tvName.text = item.name

        var mD = AppHelper.getDrawable(R.mipmap.icon_select_1)
        var mC = "#548BF7"
        if (!item.select){
            mD =  AppHelper.getDrawable(R.mipmap.icon_select)
            mC = "#000000"
        }

        tvName.setTextColor(Color.parseColor(mC))
        ivSelect.setImageDrawable(mD)
    }
}